﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Titan.Runtiming
{
    public abstract class RuntimeService
    {
        protected RuntimeService() { }

        protected internal virtual void SetRuntime(Runtime runtime)
        {
            if (_runtime != null)
                throw new InvalidOperationException("");
            _runtime = runtime;
            OnSetRuntime(runtime);

        }

        public Runtime Runtime
        {
            get { return _runtime; }
        }

        protected internal virtual void Start() { }

        protected internal virtual void Stop() { }

        protected internal virtual void OnSetRuntime(Runtime runtime) { }

        private Runtime _runtime;
    }
}
